package HashMapEasy;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main
{

    public static void main(String[] args) {
        HashMap<Integer, String> map = new HashMap<Integer, String>();

        System.out.print("Write number: ");
        Scanner sc = new Scanner(System.in);
        String ID = sc.nextLine();
        int id = Integer.parseInt(ID);

        System.out.print("Write name: ");
        String name = sc.nextLine();
        map.put(id, name);
        System.out.println(map.isEmpty() + " внесено");

        Set set = map.entrySet();
        System.out.println(set);

        Iterator iter = set.iterator();
        while (iter.hasNext()) {
            Map.Entry mapIter = (Map.Entry) iter.next();
            System.out.println("Содержимое: " + mapIter.getKey() + " " + mapIter.getValue());

        }

        HashMap<String, Integer> charMap = new HashMap<String, Integer>();

        String str = name;
        char[] charArr = str.toCharArray();
//        charMap.put(str, id);

        for (int i = 0; i < charArr.length; i++) {
//            System.out.print(charArr[i] + " ");
            if (charMap.containsKey(i)) {
                charMap.get(String.valueOf(charArr[i]));

            }

        }

    }

}
